// import { Button } from "antd";
import "./App.css";
import MainLayout from "./layout";
import Login from "./views/login";
import { Route, Routes } from "react-router-dom";
import { mainRoutes } from "./router";
import NotFound from "./views/not-found";
import RquireAuth from "./guard/RquireAuth";
import { renderRoutes } from "./router/utils";

function App() {
  return (
    <>
      <Routes>
        <Route
          path="/"
          element={
            <RquireAuth>
              <MainLayout />
            </RquireAuth>
          }
        >
          {/* 列表渲染路由 */}
          {renderRoutes(mainRoutes)}
        </Route>
        <Route path="/login" element={<Login />} />
        <Route path="*" element={<NotFound />} />
      </Routes>
    </>
  );
}

export default App;
